package com.zxl.yjb.adapter;

import android.widget.ImageView;
import android.widget.RatingBar;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zxl.yjb.GlideApp;
import com.zxl.yjb.R;
import com.zxl.yjb.bean.CommenBean;
import com.zxl.yjb.bean.CommentBean;
import com.zxl.yjb.widget.CircleImageView;

public class MyFragmentCommentAdapter extends BaseQuickAdapter<CommentBean.ListBean, BaseViewHolder> {

    public MyFragmentCommentAdapter(int layoutResId) {
        super(layoutResId, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentBean.ListBean item) {
        helper.setText(R.id.tv_user_name, item.getNickname());
        helper.setText(R.id.tv_comment_content, item.getText());
        RatingBar rbStart = helper.getView(R.id.rb_star);
        rbStart.setRating(Integer.parseInt(item.getStar()));
        // 加载网络图片
        GlideApp.with(mContext).load(item.getFace_image()).into((CircleImageView) helper.getView(R.id.iv_user_header));
    }

}
